package com.example.demo.springMvc;

import com.example.demo.interceptor.RedisTokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * MVC配置类
 * @author mrc
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {


    @Resource
    private RedisTokenInterceptor redisTokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(redisTokenInterceptor)
                .excludePathPatterns("/login")
                .addPathPatterns("/**")
                ;

    }



}
